import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: dell
 * Date: 2023-12-03
 * Time: 10:16
 */
public class Main {
    public static void main(String[] args) {
//ASIC码：数字0是48，char型比int型数字大48
        String str="+123456789";
        char[] ch=str.toCharArray();
        int len=str.length();
        if(len==0)
            System.out.println("错误");
        int ans=0,m=0;
        for(int i=len-1;i>=0;i--){
            //如果非数字和符号，直接return 0
            if((ch[i]<48||ch[i]>48+9)&&ch[i]!='+'&&ch[i]!='-')
                //如果是数字，就从低位到高位累加，每次扩大10倍
                if(ch[i]>=48&&ch[i]<=48+9)ans+=(ch[i]-48)*Math.pow(10,m++);
            //System.out.println(ans);
        }
        if(ch[0]=='-')
            System.out.println(-ans);;

    }
    public static boolean add(char ch){
        if((ch>='0'&&ch<='9')||(ch=='+'||ch=='-')){
            return true;
        }else{
            return false;
        }
    }

    public static void main6(String[] args) {
        String str="+123456789";
        int a=str.length();
        int sb =0;
        int b=0;
        for(int i=0;i<=a-1;i++){
            if(add(str.charAt(i))){
                if(str.charAt(i)=='+'||str.charAt(i)=='-'){
                    if(str.charAt(i)=='-'){
                        b=1;
                        continue;
                    }
                }else{
                    sb=sb*10+(int)(str.charAt(i)-'0');
                    System.out.println(sb);
                }

            }else{
                System.out.println("错误");
                break;
            }
        }
        if(b==0){
            System.out.println(sb);
        }else{
            System.out.println(-sb);
        }
    }
    public static void main5(String[] args) {
        String s = "\"race a car\"";
        String str =s.toLowerCase();
        int left =0;
        int right =str.length()-1;
        while(left<right){
            while(add(str.charAt(left))&&left<right){
                left++;
            }
            System.out.println(str.charAt(left));
            while(add(str.charAt(right))&&left<right){
                right--;
            }
            System.out.println(str.charAt(right));
            if (str.charAt(left)!=str.charAt(right)){
                System.out.println("flase");
                break;
            }else {
                left++;
                right--;
            }
        }
        System.out.println("true");
    }
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);

        String s=in.nextLine();
        String ste =s.toLowerCase();
        String[] array=s.split(" ");
        System.out.println(array.length);
        int a=array[array.length-1].length();
        System.out.println(a);

        //System.out.println(Arrays.toString(array));
    }
    public static int main2(String[] args) {
        Scanner in = new Scanner(System.in);
        String s=in.nextLine();
        int n=s.lastIndexOf(" ");
        String str = s.substring(n,s.length());
        int a=str.length();
        return a;
    }
    public static int main1(String[] args) {
        String s = "hheello";
        int[] array = new int[26];
        for (int i = 0; i < s.length(); i++) {
            char a = s.charAt(i);
            array[a - 97]++;
        }
        for (int j = 0; j < s.length(); j++) {
            char a = s.charAt(j);
            if (array[a - 97]==1){
                return j;
            }
        }
        return -1;
    }
}